package com.example.agriculturemachine.ui.activity;

import android.content.Intent;
import android.content.SharedPreferences;

import com.example.agriculturemachine.R;
import com.example.agriculturemachine.base.BaseActivity;
import com.example.agriculturemachine.untils.LogUtils;

public class StartActivity extends BaseActivity {


    @Override
    protected int getLayoutResId() {
        return R.layout.activity_start;
    }

    @Override
    protected void initView() {
        SharedPreferences sp_name = getSharedPreferences("sp_name", MODE_PRIVATE);//读取数据
        boolean isOk = sp_name.getBoolean("isOk", true);
        LogUtils.d(this,"ok----->"+isOk);
        if(!isOk){
            SharedPreferences.Editor edit = sp_name.edit();//
            edit.putBoolean("isOk",false);
            edit.apply();
            //跳转到引导页
            startActivity(new Intent(this, IntroductoryActivity.class));
        }else{
            //直接进入登录页面
            startActivity(new Intent(this,LoginActivity.class));
        }
        finish();
    }
}